﻿@using Super.Infrastructure
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="VIP结婚网专门为准新人们提供结婚相关知识和消费指南，让消费者通过最简单的办法：点击鼠标来获得结婚所需要的商品或服务。打造最专业的一站式结婚VIP服务平台" />
    <meta name="keywords" content="常州喜宴,常州婚纱,常州酒店,常州喜糖喜帖,常州新娘,常州礼服,常州摄影,常州跟妆,常州彩妆,常州跟拍,常州婚车,常州婚庆,常州习俗,常州结婚网,常州摄影工作室,常州婚纱会所,常州VIP结婚网" />
    <title>@ViewBag.Title</title>
    <link href="/Assets/Style/base.css" rel="stylesheet" media="all">
    <link href="/Assets/Style/header.css" rel="stylesheet" media="all">
    <link href="/Assets/Style/bbs.css" rel="stylesheet" media="all">
    <link type="text/css" rel="stylesheet" href="/Assets/Plus/jBox/Skins/Red/jbox.css" />
    <script src="/Assets/script/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="/Assets/script/common.js" type="text/javascript"></script>
    <script src="/Assets/script/jquery.json.js" type="text/javascript"></script>
    <script type="text/javascript" src="/Assets/Plus/jBox/jquery.jBox-2.3.min.js"></script>
    <!--[if IE 6]>
            <script type="text/javascript" src="/Assets/script/DD_belatedPNG_0.0.8a-min.js" ></script>
            <script type="text/javascript">
                DD_belatedPNG.fix('.nav_con_on, .nav_con a:hover,.n_l_tit,.list_02_t b');
            </script>
        <![endif]-->
    <!--[if IE]>
            <style type="text/css">
                #box_con { padding:0px 5px 5px 5px !important; }
            </style>
        <![endif]-->
    @{
        var userCategory = CacheService.GetForumCategory();
        var shopCategory = CacheService.GetShopCategory().Where(a => a.ParentId > 0).ToList();
        var advers = CacheService.GetAdvertList().Where(a => a.Location == (int)AdvertLocationEnum.ForumRecommend & a.IsDel == (int)IsDeletedEnum.False).Take(5).ToList();
        var players = CacheService.GetAdvertList().Where(a => a.Location == (int)AdvertLocationEnum.ForumSlider & a.IsDel == (int)IsDeletedEnum.False).Take(5).ToList();
        var bigTitle = CacheService.GetAdvertList().Where(a => a.Location == (int)AdvertLocationEnum.ForumBigTitle & a.IsDel == (int)IsDeletedEnum.False).OrderBy(a => a.Sort).FirstOrDefault();


        var adp = new DbContextAdapter();
        var topicService = new TopicService(adp);
        var postService = new PostService(adp);
        var specials = topicService.Repository.Find(a => a.Special == (int)Special.Level3 & a.IsDel == (int)IsDeletedEnum.False).Take(10).ToList();

        var topicCount = topicService.GetTopicCount();
        var postCount = postService.GetPostCount();

        var keyword = CacheService.GetSetting().HotKeyWord;

        string[] hotkeys = new string[10];
        if (!string.IsNullOrEmpty(keyword))
        {
            hotkeys = keyword.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
        }
        
    }
    <style type="text/css">
        li { list-style: none outside none; }
        .play { height: 260px; overflow: hidden; position: relative; width: 330px; }
        .play ol { bottom: 3px; height: 20px; padding-left: 200px; position: absolute; z-index: 3; }
        .play ol li { cursor: pointer; display: inline; float: left; width: 15px; height: 15px; line-height: 15px; margin-right: 8px; border: solid 1px orange; background: white; text-align: center; }
        .play ol li.active { background: red; color: white; }
        .play ul { position: absolute; z-index: 1; width: 328px; height: 258px; border: solid 1px #ccc; }
    </style>
    <script type="text/javascript">
        $("#searchTopic").live("click", function () {
            var content = $("#SearchTag").val();
            if (content == "")
                return false;
            window.location.href = "/topic?search=" + content + "#TopicNav";
        });
    </script>
</head>
<body>
    @*引入头部内容模版*@
    @RenderPage("~/Views/Shared/_IncludeHeader.cshtml")
    <!--/头部-->
    <div class="mian mc h_auto">
        @*引入左栏菜单模版*@
        @RenderPage("~/Views/Shared/_IncludeLeftMenu.cshtml")
        <!--mian_left-->
        <div class="m_right fr mb20">
            <div class="n_right mb20">
                @*<b class="nr_t">婚纱摄影</b>*@
                <!--/tit-->
                <div class="nr_news mb20 h_auto">
                    <div id="play" class="nr_l fl play">
                        <ol>
                            @for (int i = 0; i < players.Count; i++)
                            {
                                if (i == 0)
                                {
                                <li class="active" title="@players[i].Title">@(i + 1)</li>
                                }
                                else
                                {
                                <li title="@players[i].Title">@(i + 1)</li>
                                }

                            }
                        </ol>
                        <ul id="imgList">
                            @for (int i = 0; i < players.Count; i++)
                            {
                                if (i == 0)
                                {
                                <li><a href="@players[i].Href">
                                    <img src="@players[i].ImageUrl" alt="@players[i].Title" title="@players[i].Title" width="328px" height="258px" />
                                </a></li>
                                }
                                else
                                {
                                <li style="display: none"><a href="@players[i].Href">
                                    <img src="@players[i].ImageUrl" alt="@players[i].Title" title="@players[i].Title" width="328px" height="258px" />
                                </a></li>
                                }
                            }
                        </ul>
                        <div id="playTitle" style="width: 328px; position: absolute; z-index: 1; margin: 234px auto 5px auto; padding: 0 4px; height: 25px; line-height: 25px; background: none repeat scroll 0pt 0pt rgb(0, 0, 0); color: white; font-weight: bold; opacity: 0.5;">
                            @{
                                if (players.Count > 0)
                                {
                                @players[0].Title;
                                }
                            }
                        </div>
                    </div>
                    <script type="text/javascript">
                        var ppp = init();
                        var nowLi = $('#imgList li').first();
                        var nowInx = 0;

                        $('#play').mouseover(function () { clearInterval(ppp); });
                        $('#play').mouseout(init);
                        $('#play ol li').mouseover(function () {
                            ShowLi(parseInt($(this).html()) - 1);
                        });

                        function init() {
                            return ppp = setInterval(function () { ShowLi(++nowInx); }, 3000);
                        }

                        function ShowLi(inx) {
                            var pol = $('#play ol li');

                            if (inx > pol.length - 1)
                                inx %= pol.length;

                            pol.removeClass("active");
                            pol.eq(pol.length - inx - 1).addClass("active");

                            nowLi.hide();
                            nowLi = $('#imgList li').eq(inx);
                            nowLi.fadeIn(800);
                            $("#play ol li").removeClass("active").eq(inx).addClass("active");
                            var title = pol.eq(inx).attr('title');
                            $('#playTitle').text(title);
                            nowInx = inx;
                        }
                    </script>
                    <div class="nr_r fr">
                        <div class="h_auto">
                            <div class="search line fl">
                                <input type="text" class="text_01 fl" value="输入关键词" id="SearchTag" name="SearchTag" maxlength="40" />
                            </div>
                            <a href="javascript:void(0)" class="btn_06 fr" id="searchTopic">搜索</a>
                        </div>
                        <div class="hot_search mb10">
                            热门搜索：
                            @{
                                if (hotkeys != null)
                                {
                                    foreach (var hotkey in hotkeys)
                                    {
                                        if (!string.IsNullOrEmpty(hotkey))
                                        {
                                <a href="/topic?search=@hotkey#TopicNav">@hotkey</a>
                                        }

                                    }
                                }
                            
                            }
                        </div>
                        <!--/search-->
                        <script type="text/javascript">
                            $(".text_01").focus(function () {
                                $(this).val("");
                                $(this).css("color", "#333");
                            }); //搜索框
                        </script>
                        <div class="news_01">
                            @{
                                if (bigTitle != null)
                                {
                                <h4>
                                    <a href="@bigTitle.Href" target="_bank">@bigTitle.Title</a></h4>
                                }
                            }
                            <ul>
                                @foreach (var sp in specials)
                                {
                                    if (sp.Type == (int)ForumType.User)
                                    {
                                    <li><a target="_bank" href="/topic-@(sp.ID)" class="c_blue_2">@sp.Title.Cut(30)</a></li>
                                    }

                                    if (sp.Type == (int)ForumType.Shop)
                                    {
                                    <li><a target="_bank" href="/shop/@sp.Shop_ID/forum-@sp.ID">@sp.Title.Cut(30)</a></li>
                                    }

                                }
                            </ul>
                        </div>
                    </div>
                </div>
                <!--/nr_news-->
                <div class="adv_02">
                    <ul class="h_auto">
                        @foreach (var adver in advers)
                        {
                            
                            <li><a href="@adver.Href">
                                <img src="@adver.ImageUrl" width="142" height="150" />
                            </a><a href="@adver.Href">@adver.Title.Cut(20)</a> </li>  
                            
                        }
                    </ul>
                </div>
                <!--/adv_02-->
            </div>
            <div>
                <div class="l_nav" id="TopicNav">
                    <div class="l_nav_cl">
                        <span class="current" id="usernav"><a href="/topic#TopicNav">经验交流</a> </span><span id="shopnav"><a href="/topic?m=shop#TopicNav">商家活动</a> </span><p><b class=" f14 fw c_red">官方交流群：38766313&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>主题数：<b class="c_red">@topicCount</b> 帖子数：<b class="c_red">@postCount</b> @*排序：<a class="c_ccc" href="?">最新回复</a> | <a class="c_blue fw">最新发帖</a>*@</p>
                        <a href="/topic/create" class="new_t"></a>
                    </div>
                    <!--0_0-->
                    <div class="l_nav_con">
                        <ul id="userul">
                            @{
                                foreach (var category in userCategory)
                                {
                                <li><a href="/topic?c=@category.ID#TopicNav">@category.Name</a></li>
  
                                }
                            }
                        </ul>
                        <ul id="shopul">
                            @{
                                <li><a href="/topic?c=&m=shop#TopicNav">全部</a></li>
                                foreach (var category in shopCategory)
                                {
                                <li><a href="/topic?c=@category.ID&m=shop#TopicNav">@category.Name</a></li>
                                }
                            }
                        </ul>
                    </div>
                    <script type="text/javascript">
                        $(function () {
                            var _hover = 'current'; //当前点击显示的样式 
                            var model = $.query("m");
                            var s = model.split('#');
                            if (s.length == 2) {
                                model = s[0];
                            }

                            if (model == 'shop') {
                                $("#shopnav").addClass(_hover).siblings().removeClass(_hover);
                                $("#shopul").attr("style", "display:block");
                                $("#userul").attr("style", "display:none");
                            } else {
                                $("#usernav").addClass(_hover).siblings().removeClass(_hover);
                                $("#shopul").attr("style", "display:none");
                                $("#userul").attr("style", "display:block");
                            }

                        });
                    </script>
                    <!--0_0-->
                </div>
                <!--/nav-->
                @RenderBody()
            </div>
            <!--/news-->
            @*右栏内容开始标记*@
        </div>
        <!--mian_right-->
    </div>
    <!--/首页主体-->
    @RenderPage("~/Views/Shared/_IncludeFooter.cshtml")
    <!--/尾部-->
</body>
</html>
